package com.sojson.project.dao.impl;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.sojson.base.impl.BaseDaoImpl;
import com.sojson.project.dao.GoodCateDao;
import com.sojson.project.entity.po.GoodCate;
import com.sojson.project.query.entity.bo.Select;

/**
 * 商品分类表Dao实现类(目的:把分页插件从Service层分离,这样就不用每次调Dao接口都要分页)
 * 
 * @author liu
 * @date 2021-03-16
 */
@Repository
public class GoodCateDaoImpl extends BaseDaoImpl<GoodCateDao, GoodCate> implements GoodCateDao {

    @Resource
    private GoodCateDao goodCateDao;

    /**
     * 单条插入
     * 
     * @param goodCate
     * @return
     * @throws SQLException
     */
    @Override
    public int insert(GoodCate goodCate) {
        return goodCateDao.insert(goodCate);
    }

    /**
     * 批量插入
     * 
     * @param goodCate
     * @return
     * @throws SQLException
     */
    @Override
    public int insertList(List<GoodCate> goodCates) {
        return goodCateDao.insertList(goodCates);
    }

    /**
     * 通过对象批量删除(物理删除)
     * 
     * @param goodCate
     * @return
     * @throws SQLException
     */
    @Override
    public int deleteByDto(GoodCate goodCate) {
        return goodCateDao.deleteByDto(goodCate);
    }

    /**
     * 统计全部数量
     * 
     * @return
     * @throws SQLException
     */
    @Override
    public int countAll() {
        return goodCateDao.countAll();
    }

    /**
     * 查询所有
     * 
     * @return
     * @throws SQLException
     */
    @Override
    public List<GoodCate> listAll() {
        return goodCateDao.listAll();
    }

    /**
     * 根据对象统计数量
     * 
     * @param goodCate
     * @return
     * @throws SQLException
     */
    @Override
    public int countByDto(GoodCate goodCate) {
        return goodCateDao.countByDto(goodCate);
    }

    /**
     * 根据对象查询
     * 
     * @param goodCate
     * @return
     * @throws SQLException
     */
    @Override
    public List<GoodCate> listByDto(GoodCate goodCate) {
        startPage(goodCate);
        return goodCateDao.listByDto(goodCate);
    }

    /**
     * 通过id删除(物理删除)
     * 
     * @param id
     * @return
     * @throws SQLException
     */
    @Override
    public int deleteById(Integer id) {
        return goodCateDao.deleteById(id);
    }

    /**
     * 通过id列表删除(物理删除)
     * 
     * @param ids
     * @return
     * @throws SQLException
     */
    @Override
    public int deleteByIdList(ArrayList<Integer> ids) {
        return goodCateDao.deleteByIdList(ids);
    }

    /**
     * 通过id更新(全部更新)
     * 
     * @param goodCate
     * @return
     * @throws SQLException
     */
    @Override
    public int updateById(GoodCate goodCate) {
        return goodCateDao.updateById(goodCate);
    }

    /**
     * 通过id列表更新(全部更新)(更新内容相同)
     * 
     * @param goodCate
     * @return
     * @throws SQLException
     */
    @Override
    public int updateStaticByIdList(GoodCate goodCate) {
        return goodCateDao.updateStaticByIdList(goodCate);
    }

    /**
     * 通过id列表更新(全部更新)(更新内容不相同)
     * 
     * @param goodCates
     * @return
     * @throws SQLException
     */
    @Override
    public int updateChangeByIdList(ArrayList<GoodCate> goodCates) {
        return goodCateDao.updateChangeByIdList(goodCates);
    }

    /**
     * 通过id更新(局部更新)
     * 
     * @param goodCate
     * @return
     * @throws SQLException
     */
    @Override
    public int updatePartialById(GoodCate goodCate) {
        return goodCateDao.updatePartialById(goodCate);
    }

    /**
     * 通过id列表更新(局部更新)(更新内容相同)
     * 
     * @param goodCate
     * @return
     * @throws SQLException
     */
    @Override
    public int updateStaticPartialByIdList(GoodCate goodCate) {
        return goodCateDao.updateStaticPartialByIdList(goodCate);
    }

    /**
     * 通过id列表更新(局部更新)(更新内容不相同)
     * 
     * @param goodCates
     * @return
     * @throws SQLException
     */
    @Override
    public int updateChangePartialByIdList(ArrayList<GoodCate> goodCates) {
        return goodCateDao.updateChangePartialByIdList(goodCates);
    }

    /**
     * 通过id查询
     * 
     * @param id
     * @return
     * @throws SQLException
     */
    @Override
    public GoodCate findById(String id) {
        return goodCateDao.findById(id);
    }

    /**
     * 通过id列表查询
     * 
     * @param ids
     * @return
     * @throws SQLException
     */
    @Override
    public ArrayList<GoodCate> findByIdList(ArrayList<Integer> ids) {
        return goodCateDao.findByIdList(ids);
    }

    /**
     * 通过对象查询id列表
     * 
     * @param goodCate
     * @return
     * @throws SQLException
     */
    @Override
    public ArrayList<Integer> findIdByDto(GoodCate goodCate) {
        return goodCateDao.findIdByDto(goodCate);
    }

    /**
     * 清空数据(物理清空)
     * 
     * @throws SQLException
     */
    @Override
    public void clear() {
        goodCateDao.clear();
    }

    /**
     * 根据对象查询
     * 
     * @param goodCate
     * @return
     */
    @Override
    public List<Select> findSelect(GoodCate goodCate) {
        startPage(goodCate);
        return goodCateDao.findSelect(goodCate);
    }

}